package person.bing.fbcloud.auth.endpoint;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import person.bing.fbcloud.common.core.util.R;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author: mengfanbing
 * @date: 2019/12/30 11:27
 */
@Slf4j
@RestController
@RequestMapping("/token")
public class TokenEndpointBing {

    /**
     * session测试
     *
     * @return ModelAndView
     */
    @GetMapping("/aaaa")
    public R session() {

//        HttpSession session = HttpServletActionContext.getRequest().getSession();
        return new R();
    }

    /**
     * 认证页面
     *
     * @return ModelAndView
     */
    @GetMapping("/login")
    public ModelAndView require() {
        log.error("我是登录页");
        return new ModelAndView("ftl/login");
    }

    /**
     * 认证页面
     *
     * @return ModelAndView
     */
    @GetMapping("/test")
    public R test() {
        return new R("孟凡兵token");
    }
}
